package com.xhkj.controller;

import java.time.LocalDateTime;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.xhkj.mapper.my.JuBaoMapper;
import com.xhkj.model.JuBao;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;

@Api(tags = { "02.举报" })
@RestController
@RequestMapping("jubao")
public class JuBaoController {

	@Autowired
	private JuBaoMapper mapper;

	@ApiOperation(value = "举报")
	@ApiImplicitParams({
			@ApiImplicitParam(name = "req", value = "错误信息实体", required = true, dataTypeClass = JuBao.class, paramType = "body"),
	})
	@PostMapping("add")
	public Object add(@RequestBody JuBao req) {
		req.setId(null);
		req.setCreateTime(LocalDateTime.now());
		mapper.insert(req);
		return req;
	}


}
